#pragma once

#ifdef CANCARD_EXPORTS
#define CANCARD_API __declspec(dllexport)
#else 
#define CANCARD_API __declspec(dllimport)
#endif

#define ARRAY_SIZE(T) (sizeof(T)/sizeof(T[0]))

enum t_CanCard {TCanUnknown = 0, TCanNI, TCanPCan, TCanAE, TCanNSI, TCanPCanPCI, TCanFake};
CANCARD_API const char* t_CanCardToText(t_CanCard es);
CANCARD_API t_CanCard Tot_CanCard(const char* text);

class GenericCanCard
{
public:
	virtual ~GenericCanCard(){};
	virtual bool good()=0;
	virtual bool SendMsg(unsigned int ID, unsigned short DataLen, unsigned char* Data)=0;
	virtual bool RcvMsg(unsigned int& ID, unsigned short& DataLen, unsigned char* Data)=0;
};

CANCARD_API GenericCanCard* NewCanCard(t_CanCard Api, int Carte, int Bus, bool VerboseLog, int frequency);
